#include "fractionTask.h"


FractionTaskNode::FractionTaskNode(void)
{
	int i;
	for(i = 0; i < 4; i++){
		this->numerator[i] = 0;
		this->denominator[i] = 0;
	}
	this->denominator[4] = 0;
}


FractionTaskNode::~FractionTaskNode(void)
{
}

void FractionTaskNode::setNumerator(int n1, int n2, int n3, int n4){
	this->numerator[0] = n1;
	this->numerator[1] = n2;
	this->numerator[2] = n3;
	this->numerator[3] = n4;
}
void FractionTaskNode::setDenominator(int n1, int n2, int n3, int n4, int n5){
	this->denominator[0] = n1;
	this->denominator[1] = n2;
	this->denominator[2] = n3;
	this->denominator[3] = n4;
	this->denominator[4] = n5;
}

double FractionTaskNode::getValue(void){
	int num = this->numerator[0]*1000 + this->numerator[1]*100 + this->numerator[2]*10 + this->numerator[3];
	int den = this->denominator[0]*10000 + this->denominator[1]*1000 + this->denominator[2]*100 + this->denominator[3]*10 + this->denominator[4];

	return num/den;
}